package com.pty.demo.structural.decorator;

import java.math.BigDecimal;

/**
 * @author pengty
 * @date 2020/3/12
 */
public class StrawberryDecorator extends AbstractFruitDecorator {

    public StrawberryDecorator(CakeComponent cakeComponent) {
        super(cakeComponent);
    }

    @Override
    public BigDecimal price() {
        return cakeComponent.price().add(BigDecimal.valueOf(50));
    }

    @Override
    public String name() {
        return cakeComponent.name() + " 加草莓";
    }
}
